<?php
require_once("layout_config.php");
require_once("include/permission.php");
require_once("include/user.php");

/* check if the user is logged. */
$user_id = permission_redirect_user("login.php");
?>
<html>
	<head>
		<title><?=$layout_project_name?></title>
		<link type="text/css" rel="stylesheet" href="themes/<?=$layout_theme?>/main.css" />
		<script type='text/javascript' src='js/jquery.js'></script>
		<script type='text/javascript' src='js/jquery.progressbar.min.js'></script>
		<script type='text/javascript' src='js/utils.js.php'></script>
		<script type='text/javascript' src='js/jquery.validate.js'></script>
		<script type='text/javascript' src='js/thickbox.js.php'></script>
	</head>
<body>
<?php
$menu_module = "configuration";
include("header.php");
?>
<br />
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="project_table" align="center">
<tr>
<td>
	<table width="100%" border="0" cellpadding="1" cellspacing="1">
	<tr>
		<td colspan="8" class="project_title">
			<table width='100%' border='0' cellpadding='0' cellspacing='0'>
			<tr>
				<td align='center' class="project_title"><?=_("User list"); ?></td>
				<td width='79'>
					<a class="thickbox" href="user_add.php?modal=true">
					<img src=themes/<?=$layout_theme;?>/images/btn_adduser.jpg border="0"/>
					</a>
				</td>
			<td>
			</table>
		</td>
	</tr>
	<tr>
		<td width="20" class="project_subtitle">D</td>
		<td width="20" class="project_subtitle">M</td>
		<td class="project_subtitle"><?=_("Name")?></td>
		<td class="project_subtitle"><?=_("Lasname")?></td>
		<td class="project_subtitle"><?=_("Alias")?></td>
		<td class="project_subtitle"><?=_("Email")?></td>
		<td class="project_subtitle"><?=_("Access level")?></td>
	<tr>
	<?
	$users = user_list(1);
	if (!is_array($users)) {
		echo "<tr><td colspan='8' class='item' align='center' height='20'>"._("No user registred")."</td></tr>";
	} else {
		foreach ($users AS $key => $user) {
			if ($class == 'project_item_cebra') {
				$class = 'project_item';
			} else {
				$class = 'project_item_cebra';
			}

			echo "<tr>";
			echo "<td class='$class' align='center'><img src=themes/$layout_theme/images/ico_delete.gif /></td>";
			echo "<td class='$class' align='center'><img src=themes/$layout_theme/images/ico_modify.gif /></td>";
			echo "<td class='$class'>&nbsp;{$user["name"]}</td>";
			echo "<td class='$class'>&nbsp;{$user["lastname"]}</td>";
			echo "<td class='$class'>&nbsp;{$user["alias"]}</td>";
			echo "<td class='$class'>&nbsp;{$user["email"]}</td>";
			echo "<td class='$class'>&nbsp;{$user["access_level"]}</td>";
			echo "</tr>";
		}
	}
	?>
	</table>
</td>
</tr>
</table>
</body>
</html>
